package com.czy.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

import java.net.InetAddress;

/**
 * Springboot启动后执行
 * @author czy
 * @date 2021/3/29
 */
@Component
@Slf4j
public class ApplicationRunnerImpl implements ApplicationRunner {
    @Value("${server.port}")
    private String port;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        String hostAddress = InetAddress.getLocalHost().getHostAddress();
        log.info("项目jdk位数: {}位",System.getProperty("sun.arch.data.model"));
        log.info("项目存放地址: {}",System.getProperty("user.dir"));
        log.info("swagger 访问地址 http://{}:{}/doc.html",hostAddress,port);
    }
}
